package com.lagou.edu.common.utils;

import com.lagou.edu.common.bean.Response;
import com.lagou.edu.common.constant.ResponseCode;

/**
 * created by kirito at 2020/7/19
 */
public class ResponseUtil {

    public static Response response(ResponseCode responseCode) {
        Response response = new Response();
        response.setCode(responseCode.getCode());
        response.setMessage(responseCode.getMessage());
        return response;
    }

    public static Response response(ResponseCode responseCode, Object data) {
        Response response = response(responseCode);
        response.setData(data);
        return response;
    }
}
